﻿using System;
using System.ComponentModel;
using NjamNjam.Model.Entities;

namespace NjamNjamAdminApp.Models
{
    public class KriterijumiPretrageRestorana : INotifyPropertyChanged
    {
        public KriterijumiPretrageRestorana()
        {
            Latituda = 45.2447559;
            Longituda = 19.83772;
            Razdaljina = 5000;
        }

        private double? m_Latituda;
        public double? Latituda
        {
            get { return m_Latituda; }
            set
            {
                if (m_Latituda != value)
                {
                    m_Latituda = value;
                    OnPropertyChanged("Latituda");
                }
            }
        }

        private double? m_Longituda;
        public double? Longituda
        {
            get { return m_Longituda; }
            set
            {
                if (m_Longituda != value)
                {
                    m_Longituda = value;
                    OnPropertyChanged("Longituda");
                }

                
            }
        }

        private double? m_Razdaljina;
        public double? Razdaljina
        {
            get { return m_Razdaljina; }
            set
            {
                if (m_Razdaljina != value)
                {
                    m_Razdaljina = value;
                    OnPropertyChanged("Razdaljina");
                }
                
            }
        }

        public VrstaRestorana VrstaRestorana { get; set; }
        public DateTime? RadnoVremeOd { get; set; }
        public DateTime? RadnoVremeDo { get; set; }

        public Ponuda IzabranaPonuda { get; set; }
        
        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string property)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(property));
        }
    }
}